package com.xplusplus.security.repository;

import com.xplusplus.security.domain.ImportUserMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @Author: zhouweixin
 * @Description:
 * @Date: Created in 21:12 2018/10/24
 * @Modified By:
 */
@Repository
public interface ImportUserMessageRepository extends JpaRepository<ImportUserMessage, Long> {
    /**
     * 通过时间查询
     *
     * @param time
     * @return
     */
    List<ImportUserMessage> findByTime(Date time);

    /**
     * 通过主键批量删除
     *
     * @param ids
     */
    void deleteByIdIn(List<Long> ids);

    /**
     * 通过状态和时间查询
     *
     * @param status
     * @param time
     * @return
     */
    List<ImportUserMessage> findByStatusAndTime(String status, Date time);

    /**
     * 查询最新的
     *
     * @return
     */
    ImportUserMessage findFirstByOrderByIdDesc();
}
